package com.lifa.service.impl;


import com.lifa.dao.FuwuXiangmuDao;
import com.lifa.entity.FuwuXiangmu;
import com.lifa.service.FuwuXiangmuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FuwuXiangmuServiceImpl implements FuwuXiangmuService {
    @Autowired
    private FuwuXiangmuDao fuwuXiangmuDao;

    @Autowired
    public List<FuwuXiangmu> list() {
        return fuwuXiangmuDao.query();
    }

    /**
     * 根据id删除
     * @param fuwu_Id
     * @return
     */
    @Override
    public int delete(int fuwu_Id) {
        return fuwuXiangmuDao.delete(fuwu_Id);
    }


    /**
     * 添加
     * @return
     */
    @Override
    public int zj(FuwuXiangmu fuwuXiangmu)     {
        return fuwuXiangmuDao.add(fuwuXiangmu);
    }

    /**
     * 根据id修改服务信息
     * @return
     */
    @Override
    public int update(FuwuXiangmu fuwuXiangmu) {
        return fuwuXiangmuDao.update(fuwuXiangmu);
    }

    /**
     * 根据id查询
     * @param fuwu_Id
     * @return
     */
    @Override
    public FuwuXiangmu queryById(int fuwu_Id){
        return fuwuXiangmuDao.queryById(fuwu_Id);
    }

    /**
     * 分页
     * @param name
     * @param offset
     * @param limit
     * @return
     */
    @Override
    public List<FuwuXiangmu> findAll(String name, int offset, int limit) {
        return fuwuXiangmuDao.queryPage(name,offset,limit);
    }

    @Override
    public int findTotalCount(String name) {
        return fuwuXiangmuDao.getTotalCount(name);
    }
}